package com.yjd.comm.borrow.service;

import java.util.List;
import java.util.Map;

import com.yjd.comm.base.service.IBaseService;
import com.yjd.comm.borrow.model.ProfitFormModel;
import com.yjd.comm.util.FrameUtil;

/**
 * <b>description</b>：投资回款报表业务接口<br>
 * <b>time</b>：2014-11-17 11:04:36 <br>
 * <b>author</b>：  ready likun_557@163.com
 */
public interface IProfitFormService extends IBaseService {
	/**
	 * 插入
	 * 
	 * @param model
	 * @return
	 * @throws Exception
	 */
	public ProfitFormModel insert(ProfitFormModel model) throws Exception;

	/**
	 * 更新,大于等于1表示成功，其他失败
	 * 
	 * @param model
	 * @return
	 * @throws Exception
	 */
	public int update(ProfitFormModel model) throws Exception;

	/**
	 * 根据id删除,大于等于1表示成功，其他失败
	 * 
	 * @param id
	 * @return
	 * @throws Exception
	 */
	public int delete(Long id) throws Exception;
	
	/**
	 * 批量插入回款报表
	* @param list
	* @throws Exception
	 */
	public void inserts(List<ProfitFormModel> list) throws Exception;
	
	/**
	* 根据map来更新数据
	* @param param
	* @return
	* @throws Exception
	 */
	@SuppressWarnings("rawtypes")
	public int updateByMap(Map param) throws Exception;

	/**
	* 获取回款报表列表
	* @param arrParMap
	* @return
	* @throws Exception
	 */
	public List<ProfitFormModel> getProfitFormModelsByParamMap(
			Map<Object, Object> arrParMap) throws Exception;
	
	
	/**
	* 根据债权的id删除回款报表数据
	* @param creditor_id
	* @return
	* @throws Exception
	 */
	public int deleteByCreditorId(Long creditor_id) throws Exception;
	
	/**
	 * 根据债权id获取债权回款列表
	 * 
	 * @param creditor_id
	 *            债权id
	 * @return
	 * @throws Exception
	 */
	public List<ProfitFormModel> getProfitFormModelsByCreditorId(
			Long creditor_id) throws Exception;
	
	/**
	 * 根据债权的id列表获取债权对应的回款报表
	* @param creditorIdList
	* @return
	* @throws Exception
	 */
	public Map<Long, List<ProfitFormModel>> getPfMapByCreditorIdList(
			List<Long> creditorIdList) throws Exception;

	public double getFundsSum(Map<String, Object> paramMap, String field)
			throws Exception ;
	
}
